package com.nanhai.buddhist.college.module.study.dal.mysql.studyevaluation;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.study.dal.dataobject.studyevaluation.StudyEvaluationDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.study.controller.admin.studyevaluation.vo.*;

/**
 * 学生评价 Mapper
 *
 * @author AKai
 */
@Mapper
public interface StudyEvaluationMapper extends BaseMapperX<StudyEvaluationDO> {

    default PageResult<StudyEvaluationDO> selectPage(StudyEvaluationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudyEvaluationDO>()
                .eqIfPresent(StudyEvaluationDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(StudyEvaluationDO::getTeacherId, reqVO.getTeacherId())
                .orderByDesc(StudyEvaluationDO::getId));
    }

    default List<StudyEvaluationDO> selectList(StudyEvaluationExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudyEvaluationDO>()
                .eqIfPresent(StudyEvaluationDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(StudyEvaluationDO::getTeacherId, reqVO.getTeacherId())
                .orderByDesc(StudyEvaluationDO::getId));
    }

}
